import AsyncStorage from './async-storage'

const TokenKey = "CC2021_TOKEN"

// 存储Token
let setToken = (value) => {
  AsyncStorage.set(TokenKey, value)
}

// 获取Token, callback(err, value) => { ... }
let getToken = (callback) => {
  AsyncStorage.get(TokenKey, (_, token) => {
    callback(token)
  })
}

// 移除Token存储信息
let remoteToken = () => {
  AsyncStorage.remove(TokenKey)
}

export default {
  setToken,
  getToken,
  remoteToken,
}